package com.otitan.la.forest.industry.vo;

import lombok.Data;

import java.math.BigDecimal;

/**
 * @Description: 当前类作用描述
 * @Author: xiazw
 * @CreateDate: 2020/10/20 20:29
 */
@Data
public class SecendProductAccountedVO {
    private BigDecimal secWoodcraftTaotal;
    private BigDecimal secNowoodcraftTaotal;
    private BigDecimal secWoodandotherproAllTotal;
    private BigDecimal secOtherfurniTotal;
    private BigDecimal secOtherpaperproTotal;
    private BigDecimal secChemistryproTaotal;
    private BigDecimal secTatalTatalval;
    private String secWoodcraftTaotalAccount;
    private String secNowoodcraftTaotalAccount;
    private String secWoodandotherproAllTotalAccount;
    private String secOtherfurniTotalAccount;
    private String secOtherpaperproTotalAccount;
    private String secChemistryproTaotalAccount;
    private String secTatalTatalvalAccount;

    public SecendProductAccountedVO() {
    }

    public SecendProductAccountedVO(BigDecimal secWoodcraftTaotal, BigDecimal secNowoodcraftTaotal, BigDecimal secWoodandotherproAllTotal,
                                    BigDecimal secOtherfurniTotal, BigDecimal secOtherpaperproTotal, BigDecimal secChemistryproTaotal,
                                    BigDecimal secTatalTatalval) {
        this.secWoodcraftTaotal = secWoodcraftTaotal;
        this.secNowoodcraftTaotal = secNowoodcraftTaotal;
        this.secWoodandotherproAllTotal = secWoodandotherproAllTotal;
        this.secOtherfurniTotal = secOtherfurniTotal;
        this.secOtherpaperproTotal = secOtherpaperproTotal;
        this.secChemistryproTaotal = secChemistryproTaotal;
        this.secTatalTatalval = secTatalTatalval;
        BigDecimal allcount=secWoodcraftTaotal.add(secNowoodcraftTaotal).add(secWoodandotherproAllTotal).add(secOtherfurniTotal)
                .add(secOtherpaperproTotal).add(secChemistryproTaotal).add(secTatalTatalval);
        this.secWoodcraftTaotalAccount=secWoodcraftTaotal.divide(allcount,4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"))+"%";
        this.secNowoodcraftTaotalAccount=secNowoodcraftTaotal.divide(allcount,4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"))+"%";
        this.secWoodandotherproAllTotalAccount=secWoodandotherproAllTotal.divide(allcount,4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"))+"%";
        this.secOtherfurniTotalAccount=secOtherfurniTotal.divide(allcount,4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"))+"%";
        this.secOtherpaperproTotalAccount=secOtherpaperproTotal.divide(allcount,4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"))+"%";
        this.secChemistryproTaotalAccount=secChemistryproTaotal.divide(allcount,4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"))+"%";
        this.secTatalTatalvalAccount=secTatalTatalval.divide(allcount,4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"))+"%";

    }
    public SecendProductAccountedVO getSecendProductAccounted(SecendProductAccountedVO secend){
        return new SecendProductAccountedVO(secend.getSecWoodcraftTaotal(), secend.getSecNowoodcraftTaotal(), secend.getSecWoodandotherproAllTotal() ,
                secend.getSecOtherfurniTotal(), secend.getSecOtherpaperproTotal() , secend.getSecChemistryproTaotal(),
                secend.getSecTatalTatalval());
    }
}
